<?php
/**
 * JSON API to get all reference attributes
 * 
 * @author Xavier VILAIN
 * @package Orx\Etl\Reference
 * @license #license-orx#
 * 
 */

use Orx\Etl\Extractor\Reference;
$xview = Xview::instance();
try {
	$data = array();
	$reference = Fox\Dao::load(Reference::className(),$xview->val('data'));
	foreach($reference->attributes() as $attributeName => $value) {
		$data[] = array('label' => $attributeName,'value' => $attributeName);
	}
	echo json_encode($data);
} catch(Fox\Object\Exception\NotExist $e) {
	// Do nothing 
}